<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>商品信息添加页面</title>
  <link rel="stylesheet" href="../../../yl/index.css" />
  <!-- 布局样式 -->
  <link rel="stylesheet" href="../../../yl/style.css" />
  <link rel="stylesheet" href="../../../style/wangeditor.css">
  <link rel="stylesheet" href="../../../yl/mobile.css" />
  <link rel="stylesheet" href="../../../yl/easyui.css" />
  <link rel="stylesheet" href="../../../yl/icon.css" />
</head>

<body>
  <!-- <div id="app"> -->
  <div class="easyui-navpanel" id="app" v-cloak>
    <header>
      <div class="m-toolbar">
        <div class="m-title">{{action=='Add'?'添加商品信息':action=='Modify'?'修改商品信息':''}}</div>
      </div>
    </header>
    <div class="easyui-navpanel panel-body panel-body-nobottom panel-body-noborder" style="height: 3000px"
      id="MainTable" ref="MainTable"
      :data-options="JSON.stringify({ 'TableName': 'article_info', 'form': 'dataForm' ,'primary_key':'Article_SerialNumber' })">
      <div class="yl-main">
        <div class="table_titel">
          <div class="titel">商品信息</div>
        </div>
        <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
          <el-descriptions :column="1" size="large" border>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">商品名称</div>
              </template>
              <el-form-item prop="Article_Name" :rules="[{ required: true, message: '请输入商品名称', trigger: 'blur' }]">
                <el-input v-model="dataForm.Article_Name" class="borderless-input" placeholder="请输入商品名称" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">商品封面</div>
              </template>
              <el-form-item prop="Picture_URL" :rules="[{ required: true, message: '请上传商品封面', trigger: 'change' }]">
                <yl-upload v-model="dataForm.Picture_URL"></yl-upload>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">商品品牌</div>
              </template>
              <el-form-item prop="Brand_Name" :rules="[{ required: true, message: '请输入商品品牌', trigger: 'blur' }]">
                <el-input v-model="dataForm.Brand_Name" class="borderless-input" placeholder="请输入商品品牌" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">商品类别</div>
              </template>
              <el-form-item prop="Category_Name" :rules="[{ required: true, message: '请输入商品类别', trigger: 'blur' }]">
                <el-input v-model="dataForm.Category_Name" class="borderless-input" placeholder="请输入商品类别" />
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">兑换地点</div>
              </template>
              <el-form-item prop="Article_Exchange_SerialNumber"
                :rules="[{ required: true, message: '选择兑换地点', trigger: 'change' }]">
                <yl-select @change="changeExchange" v-model="dataForm.Article_Exchange_SerialNumber" clearable filterable
                  placeholder="请选择兑换地点" :options="exchange_address" :props="{value:'Article_Exchange_SerialNumber',label:'Address'}">
                  <el-table-column prop="Article_Exchange_SerialNumber" show-overflow-tooltip label="兑换地点流水号"></el-table-column>
                  <el-table-column prop="Article_Exchange_Name" show-overflow-tooltip label="兑换点简称"></el-table-column>
                  <el-table-column prop="Blue_Plate_Name" show-overflow-tooltip label="关联蓝牌名称"></el-table-column>
                  <el-table-column prop="Address" show-overflow-tooltip label="地址"></el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item>
            <!-- <el-descriptions-item>
              <template #label>
                <div class="cell-item">所属村行政区</div>
              </template>
              <el-form-item prop="VillageNumber" :rules="[{ required: true, message: '请选择村行政区', trigger: 'change' }]">
                <yl-cascader @change="changeVillage" v-model="dataForm.VillageNumber" filterable :options="city"
                  style="width: 100%" :props="{value:'ProvinceNumber',label:'Province',children:'children'}"
                  placeholder="请选择村行政区"></yl-cascader>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">兑换地点</div>
              </template>
              <el-form-item prop="Blue_Plate_SerialNumber"
                :rules="[{ required: true, message: '选择兑换地点', trigger: 'change' }]">
                <yl-select @change="changeBlue_Plate" v-model="dataForm.Blue_Plate_SerialNumber" clearable filterable
                  placeholder="请选择兑换地点" :options="blue_plate" :props="{value:'Blue_Plate_SerialNumber',label:'Address'}"
                  :disabled="!dataForm.VillageNumber">
                  <el-table-column prop="Blue_Plate_SerialNumber" show-overflow-tooltip label="蓝牌编号"></el-table-column>
                  <el-table-column prop="Blue_Plate_Name" show-overflow-tooltip label="蓝牌名称"></el-table-column>
                  <el-table-column prop="Village" show-overflow-tooltip label="所属行政区"></el-table-column>
                  <el-table-column prop="Address" show-overflow-tooltip label="地址"></el-table-column>
                </yl-select>
              </el-form-item>
            </el-descriptions-item>
            <el-descriptions-item>
              <template #label>
                <div class="cell-item">详细地址（包括门牌号）</div>
              </template>
              <el-form-item prop="Detailed_Address" :rules="[{ required: true, message: '请输入详细地址', trigger: 'blur' }]">
                <el-input type="textarea" :autosize="{ minRows: 2 }" v-model="dataForm.Detailed_Address"
                  class="borderless-input" placeholder="请输入详细地址" />
              </el-form-item>
            </el-descriptions-item> -->
          </el-descriptions>
        </el-form>
        <div id="ChildTable">
          <div class="table_titel">
            <div class="titel">商品规格</div>
            <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
            </div>
          </div>
          <el-form :model="{childDataForm:childDataForm.filter(item => item.Row_Status != '1')}" ref="form1"
            :inline-message="true" style="width: 100%">
            <el-descriptions :column="2" size="large" border style="margin-bottom: 10px;"
              v-for="(item,index) in childDataForm.filter(item => item.Row_Status != '1')" :key="index"
              :data-options="JSON.stringify({ 'TableName': 'article_specifications', 'form': 'childDataForm', 'ParentTableName': 'article_info'})">
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">规格名称</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Specifications_Name'"
                  :rules="[{ required: true, message: '请输入规格名称', trigger: 'blur' }]">
                  <el-input v-model="item.Specifications_Name" class="borderless-input" placeholder="请输入规格名称" />
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">规格图片</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Picture_URL'"
                  :rules="[{ required: true, message: '请输入规格名称', trigger: 'change' }]">
                  <yl-upload v-model="item.Picture_URL"></yl-upload>
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">兑换所需村民积分 <br /> (-1为不能兑换)</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Villager_Point'"
                  :rules="[{ required: true, message: '请输入规格名称', trigger: 'blur' }]">
                  <el-input v-model="item.Villager_Point" class="borderless-input" placeholder="请输入兑换所需村民积分" />
                </el-form-item>
              </el-descriptions-item>
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">兑换所需党员积分 <br /> (-1为不能兑换)</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Party_Point'"
                  :rules="[{ required: true, message: '请输入规格名称', trigger: 'blur' }]">
                  <el-input v-model="item.Party_Point" class="borderless-input" placeholder="请输入兑换所需党员积分" />
                </el-form-item>
              </el-descriptions-item>
            </el-descriptions>
          </el-form>
          <!-- <el-descriptions
            :data-options="JSON.stringify({ 'TableName': 'article_picture', 'form': 'childDataForm1', 'ParentTableName': 'article_info'})">
          </el-descriptions> -->
          <!-- <div class="table_titel">
            <div class="titel">商品主图</div>
            <div class="operation">
              <el-button type="primary" size="small" @click="handleAdd('childDataForm')">新增</el-button>
              <el-button type="danger" size="small" @click="handleRemove('childDataForm')">删除</el-button>
            </div>
          </div>
          <el-form :model="{childDataForm:childDataForm1.filter(item => item.Row_Status != '1')}" ref="form1"
            :inline-message="true" style="width: 100%">
            <el-descriptions :column="2" size="large" border style="margin-bottom: 10px;"
              v-for="(item,index) in childDataForm.filter(item => item.Row_Status != '1')" :key="index"
              :data-options="JSON.stringify({ 'TableName': 'article_specifications', 'form': 'childDataForm', 'ParentTableName': 'article_info'})">
              <el-descriptions-item>
                <template #label>
                  <div class="cell-item">规格名称</div>
                </template>
                <el-form-item :prop="'childDataForm.'+index+'.Specifications_Name'"
                  :rules="[{ required: true, message: '请输入规格名称', trigger: 'blur' }]">
                  <el-input v-model="item.Specifications_Name" class="borderless-input" placeholder="请输入规格名称" />
                </el-form-item>
              </el-descriptions-item>
            </el-descriptions>
          </el-form> -->
        </div>
      </div>
    </div>
    <footer class="botton-ann">
      <el-button @click="goBack">返回</el-button>
      <el-button type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
    </footer>
  </div>
</body>
<script src="../../../utils/utils.js"></script>
<script src="../../../config/config.js"></script>
<script src="../../../utils/compressor.js"></script>
<script src="../../../utils/wangeditor.js"></script>
<script src="../../../utils/mixins.js"></script>
<script src="../../../yl/vue.js"></script>
<script src="../../../yl/index.js"></script>
<script src="../../../yl/zh-cn.mjs"></script>
<script src="../../../yl/index.iife.min.js"></script>
<script src="../../../yl/jquery.min.js"></script>
<script src="../../../utils/jquery.cookie.js"></script>
<script src="../../../yl/jquery.easyui.min.js"></script>
<script src="../../../yl/jquery.easyui.mobile.js"></script>
<script src="../../../yl/moment.min.js"></script>
<script src="../../../api/request.js"></script>
<script src="./js/add.js"></script>

</html>